STEP 17: We will now add newrise to bally to get the new y-coordinate for the soccerball.
In , drag out Addition.
Change my_var to end_y, and replace 2+3 with newrise +bally!
We now have a new y-coordinate for our ball. We will use netx as our x-coordinate, since we want the ball to move towards the net, but end_y as the y-coordinate so that the ball only hits the net if the user was correct!
To navigate the page using the TAB key, first press ESC to exit the code editor.
t = codesters.Teacher()
ends = t.find_text("end_y")
try:
tval1 = ends[0][1].replace(" ", "")
except:
tval1 = "DNE"
t1 = TestObjective()
t1.add_success(tval1 == "end_y=newrise+bally" , "Great Job!")
t1.add_success(tval1 == "end_y=bally+newrise", "Great Job!")
t1.add_failure(tval1 == "DNE", "Did you drag out Addition and change my_var to end_y?")
t1.add_failure("+" not in tval1, "Did you drag out an Addition command?")
t1.add_failure("newrise" not in tval1, "Did you change the 2 to newrise?")
t1.add_failure("bally" not in tval1, "Did you change the 3 to bally?")
tester = TestManager()
tester.add_test_list([t1])
tester.run_tests()
tester.display_first_feedback()
Are you already running a Codesters project in another tab or window?
Micro:bit can only connect to one web page at a time.
Try stopping other Codesters projects or closing
other tabs or windows that may be using your Micro:bit.
If that doesn't fix the problem try disconnecting your Micro:bit,
reloading this page, and reconnecting your Micro:bit.